import request from '@/utils/request';

// 获取推荐文章
export function getArticles(params) {
    return request({
        url: `/article/listatc/${params.pagenum}/${params.pagesize}`,
        method: 'get'
    })
}

// 添加文章
export function addArticles(data) {
    return request({
        url: `/article/addart`,
        method: 'post',
        data:data
    })
}

// 根据id获取文章或资料详情
export function detailsArticles(params) {
    return request({
        url: `/article/detail/${params}`,
        method: 'get',
    })
}

// 搜索
export function searchArticles(params) {
    return request({
        url: `/article/selectatc/${params.pagenum}/${params.pagesize}?keyword=${params.searchValue}`,
        method: 'post'
    })
}